Skip to content

🐛 fix(tk): skip profile scripts during probe - #208

Merged
gaborbernat merged 2 commits into
tox-dev:mainfrom
gaborbernat:security/khiwvyik-tk-profile
Nov 3, 2026
Merged

gaborbernat merged 2 commits into
tox-dev:mainfrom
gaborbernat:security/khiwvyik-tk-profile

Conversation

@gaborbernat

@gaborbernat gaborbernat commented Nov 2, 2026 •

Copy link
Copy Markdown
Member

PythonInfoCollector._get_tcl_tk_libs() created a Tcl interpreter while reading library paths. With TCL_LIBRARY set and HOME absent, that could run a startup file from the caller's working directory as the caller. The probe now skips Tk startup profiles. This addresses draft advisory ANT-2026-KHIWVYIK.

Tk profile execution

tkinter.Tcl() creates a Tk object. Its initializer calls readprofile(), which loads profile files from HOME or the working directory. The collector now supplies a profile-free Tk subclass with useTk=False, retaining the Tcl library query without executing profile files.

Behavior changes

Interpreter discovery no longer runs Tk profile files while detecting Tcl/Tk libraries. The library paths remain available when tkinter supplies them; missing tkinter or a Tcl error still leaves those paths unset.

Reported by Antigravity: ANT-2026-KHIWVYIK.

@gaborbernat gaborbernat added the bug Something isn't working label Nov 2, 2026
@gaborbernat gaborbernat added the security Security fixes and advisories label Nov 3, 2026
@gaborbernat
gaborbernat merged commit f86b9ef into tox-dev:main Nov 3, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working security Security fixes and advisories

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant